package com.xsz.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Value;

import com.xsz.dto.OrderDTO;
import com.xsz.service.OrderService;

@RestController
public class TestController {

	@Resource
	OrderService orderService;
	
	@Value("${myversion}")
	String version;
	
	@RequestMapping("/hello")
	public String test1() {
		return "hello springboot2 2020"+version;
	}
	
	@RequestMapping("/allorders")
	public List<OrderDTO> getAllOrder() {
		return orderService.getAll();
	}
}
